﻿<%@ Page Title="" Language="C#" MasterPageFile="~/admin/MenuMaster.Master" AutoEventWireup="true" CodeBehind="EditDiscipline.aspx.cs" Inherits="Department.admin.Content.EditDiscipline" %>
<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server">
    <style type="text/css">
        .style2
        {
            height: 50px;
            width: 690px;
        }
        .style3
        {
            width: 574px;
        }
    </style>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" runat="server">
<div id="page-heading">
        <h1>Редакция на дисциплина</h1>
    </div>
    <table border="0" width="100%" cellpadding="0" cellspacing="0" id="content-table">
        <tr>
            <th rowspan="3" class="sized">
                <img src="../images/shared/side_shadowleft.jpg" width="20" height="300" alt="" />
            </th>
            <th class="topleft">
            </th>
            <td id="tbl-border-top">
                &nbsp;
            </td>
            <th class="topright">
            </th>
            <th rowspan="3" class="sized">
                <img src="../images/shared/side_shadowright.jpg" width="20" height="300" alt="" />
            </th>
        </tr>
        <tr>
            <td id="tbl-border-left">
            </td>
            <td>
                <!--  start content-table-inner -->
                <div id="content-table-inner">
                    <table border="0" width="100%" cellpadding="0" cellspacing="0">
                        <tr valign="top">
                            <td>
                                <!--  start step-holder -->
                                <!--  end step-holder -->
                                <!-- start id-form -->
                                <table border="0" cellpadding="0" cellspacing="0" id="id-form">
                                
                                   
                                    
                                    <tr>
                                        <th valign="top">
                                            Скрито:
                                        </th>
                                        <td class="style2">
                                            <asp:CheckBox ID="checkboxActive" runat="server" />
                                           
                                        </td>
                                        
                                    </tr>
                                    <tr>
                                        <th valign="top">
                                            Описание:
                                        </th>
                                        <td class="style2">
                                            <CKEditor:CKEditorControl ID="TextBoxText" runat="server" Height="275px" Width="752px">
		
                                            </CKEditor:CKEditorControl>
                                            
                                        </td>
                                        
                                    </tr>
                                    <tr>
                                        <th valign="top">
                                            Добави преподавател:
                                        </th>
                                        <td class="style2">
                                            <asp:DropDownList ID="lecturersDropDownList" runat="server" 
                                                DataSourceID="lecturerSqlDataSource" DataTextField="LecturerFullNameBG" 
                                                DataValueField="ID">
                                            </asp:DropDownList>
                                            <asp:SqlDataSource ID="lecturerSqlDataSource" runat="server" 
                                                ConnectionString="<%$ ConnectionStrings:DepartmentConnectionString %>" 
                                                
                                                SelectCommand="SELECT LecturersFromDB.LecturerFullNameBG, Lecturers.ID, LecturersFromDB.DepartmentID FROM Lecturers RIGHT OUTER JOIN LecturersFromDB ON Lecturers.LecturerDbID = LecturersFromDB.LecturerID WHERE (Lecturers.IsHidden = 0) AND (LecturersFromDB.DepartmentID = dbo.uf_get_department_id())">
                                            </asp:SqlDataSource>
                                            <br />
                                            <br />
                                            <asp:Button ID="addALecturerToDiscipline" runat="server" 
                                                Text="Add to this discipline" onclick="addALecturerToDiscipline_Click" />
                                        </td>
                                        
                                    </tr>
                                    <tr>
                                        <th>
                                            Преподаватели:
                                        </th>
                                        <td class="style2">
                                            <table border="0" cellpadding="0" cellspacing="0" id="product-table">
                                                <tr>
                                                    
                                                    <th class="table-header-repeat line-left minwidth-1">
                                                       
                                                            Име
                                                    </th>
                                                    <th class="table-header-options line-left" style="height: 50px">
                                                        <a href="">Действия</a>
                                                    </th>
                                                </tr>
                                              
                                                <asp:ListView ID="itemsView" runat="server" DataSourceID="uploadedFiles">
                                                    <ItemTemplate>
                                                        <tr style="">
                                                            <td align="center">
                                                                <asp:Label ID="NameLabel" runat="server" Text='<%# Eval("LecturerFullNameBG") %>' />
                                                            </td>
                                                           
                                                            <td class="options-width" align="center">
                                                                <asp:HyperLink ID="Edit" title="Редактирай" class="icon-1 info-tooltip" runat="server"
                                                                    NavigateUrl='<%#"/admin/Content/EditLecturer.aspx?id=" + DataBinder.Eval(Container.DataItem,"LectID")%>'>
                                                                </asp:HyperLink>
                                                                <asp:LinkButton ID="deleteButton" title="Премахни файл." OnCommand="markInactiveButton_Click" CommandArgument='<%#Eval("LecturerID") %>' runat="server" class="icon-2 info-tooltip"></asp:LinkButton>
                                                               <asp:Label Visible="false" ID="IDLabel" runat="server" Text='<%# Eval("LecturerID") %>' />
                                                            </td>
                                                        </tr>
                                                    </ItemTemplate>
                                                    <AlternatingItemTemplate>
                                                        <tr style="" class="alternate-row">
                                                            <td align="center">
                                                                <asp:Label ID="NameLabel" runat="server" Text='<%# Eval("LecturerFullNameBG") %>' />
                                                            </td>
                                                            <td class="options-width" align="center">
                                                            <asp:HyperLink ID="Edit" title="Редактирай" class="icon-1 info-tooltip" runat="server"
                                                                    NavigateUrl='<%#"/admin/Content/EditLecturer.aspx?id=" + DataBinder.Eval(Container.DataItem,"LectID")%>'>
                                                                </asp:HyperLink>
                                                                <asp:LinkButton ID="deleteButton" title="Премахни файл." OnCommand="markInactiveButton_Click" CommandArgument='<%#Eval("LecturerID") %>' runat="server" class="icon-2 info-tooltip"></asp:LinkButton>
                                                               <asp:Label Visible="false" ID="IDLabel" runat="server" Text='<%# Eval("LecturerID") %>' />
                                                            </td>
                                                        </tr>
                                                    </AlternatingItemTemplate>
                                                </asp:ListView>
                                            </table>
                                            <asp:DataPager ID="DataPagerListView" runat="server" PageSize="10" PagedControlID="itemsView">
                                                <Fields>
                                                    <asp:NumericPagerField ButtonType="Link" NextPageText="" PreviousPageText="" ButtonCount="999999" />
                                                </Fields>
                                            </asp:DataPager>
                                            <asp:SqlDataSource ID="uploadedFiles" runat="server" ConnectionString="<%$ ConnectionStrings:DepartmentConnectionString %>"
                                                DeleteCommand="DELETE FROM DocumentsForNews
                                                FROM            DocumentsForNews INNER JOIN
                                                                         Documents ON DocumentsForNews.DocID = Documents.ID
                                                WHERE        DocID = @DocID
                                                                             DELETE FROM Documents
                                                WHERE        ID = @DocID" SelectCommand="SELECT LecturersFromDB.LecturerFullNameBG, LecturerDiscipline.DiscID, LecturerDiscipline.LecturerID, LecturersFromDB.LecturerID AS LectID, Disciplines.DisciplineDbID FROM Lecturers INNER JOIN LecturerDiscipline ON Lecturers.ID = LecturerDiscipline.LecturerID INNER JOIN Disciplines ON LecturerDiscipline.DiscID = Disciplines.ID INNER JOIN LecturersFromDB ON Lecturers.LecturerDbID = LecturersFromDB.LecturerID WHERE (Disciplines.DisciplineDbID = @ID)"
                                                
                                                
                                                
                                                
                                                
                                                
                                                UpdateCommand="UPDATE Documents SET Name = @Name, Description = @Description, Date = @Date WHERE (ID = @ID)">
                                                <DeleteParameters>
                                                    <asp:Parameter Name="DocID" />
                                                </DeleteParameters>
                                                <SelectParameters>
                                                    <asp:QueryStringParameter Name="ID" QueryStringField="ID" />
                                                </SelectParameters>
                                                <UpdateParameters>
                                                    <asp:Parameter Name="Name" />
                                                    <asp:Parameter Name="Description" />
                                                    <asp:Parameter Name="Date" />
                                                    <asp:Parameter Name="ID" />
                                                </UpdateParameters>
                                            </asp:SqlDataSource>
                                        </td>
                                    </tr>
                               
                                    <tr>
                                        <th>
                                            &nbsp;
                                        </th>
                                        <td valign="top" class="style2">
                                            <asp:Button ID="buttonSubmit" runat="server" Text="Button" 
                                                CssClass="form-submit" OnClick="buttonSubmit_Click" />
                                        </td>
                                        <td class="style1">
                                        </td>
                                    </tr>
                                </table>
                                <!-- end id-form  -->
                            </td>
                        </tr>
                        <tr>
                            <td>
                                <img src="../images/shared/blank.gif" width="695" height="1" alt="blank" />
                            </td>
                            <td>
                            </td>
                        </tr>
                    </table>
                    <div class="clear">
                    </div>
                </div>
                <!--  end content-table-inner  -->
            </td>
            <td id="tbl-border-right">
            </td>
        </tr>
        <tr>
            <th class="sized bottomleft">
            </th>
            <td id="tbl-border-bottom">
                &nbsp;
            </td>
            <th class="sized bottomright">
            </th>
        </tr>
    </table>
</asp:Content>
